home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8395 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.mindspring.com!usenet
  2. From: rey@atl.mindspring.com (Dick Yuknavech)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Hiding a password
  5. Date: Sun, 03 Mar 1996 18:56:56 -0500
  6. Organization: No organization would have me
  7. Message-ID: <313a2f99.24058687@nntp3.mindspring.com>
  8. References: <1996Feb29.224936.137160@forest>
  9. NNTP-Posting-Host: rey.mindspring.com
  10. X-Newsreader: Forte Agent .99d/16.182
  11.  
  12. ebromber@forest.drew.edu wrote:
  13.  
  14. >I recently wrote a password program. However, there is one little flaw I 
  15. >want to fix. When the password is entered, it is visible on the screen. I 
  16. >was wondering if anyone knows how to hide the password by  printing 
  17. >asterisks instead of the actual character. 
  18. >Thanks in advance.
  19.  
  20. See if your runtime library contains a function called getpass(). It's
  21. standard on Unix and exists in the Borland C stuff for PC's. Beyond
  22. that, I can't say anything for sure, but I'll bet you a beer (Pete's
  23. Wicked Ale) that you've got it. Failing that, you'll have to use raw
  24. console I/O. Oops...getpass() works with 8-char (max) passwords. If
  25. that's why you didn't use it, then look at raw mode I/O in Unix, or
  26. getch() vs getche() in DOS.
  27. --
  28. Dick Yuknavech                               rey@mindspring.com
  29.